package com.yys.huarongdao.dao;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import androidx.annotation.Nullable;

public class MySQLiteOpenHelper extends SQLiteOpenHelper{

    public MySQLiteOpenHelper(@Nullable Context context, @Nullable String name, @Nullable SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL("CREATE TABLE user(userid INTEGER PRIMARY KEY AUTOINCREMENT,account VARCHAR(20) NOT NULL,password VARCHAR(20) NOT NULL)");
        db.execSQL("CREATE TABLE ranking_list(rank_id INTEGER PRIMARY KEY AUTOINCREMENT,rank_type INT NOT NULL,time_spent INT NOT NULL,step_spent INT ,date INT8 NOT NULL,userid INTEGER NOT NULL)");
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        return;
    }
}

